<%-- 
    Document   : categorypanelist
    Created on : Jul 14, 2012, 5:33:02 PM
    Author     : Atienza-Home
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.Iterator"%>
<%@page import="Factory.Tables.Category"%>
<%@page import="java.util.ArrayList"%>



<div id="categorypanelist" style=" width:840px;margin:auto;">
    
    <% 
        ArrayList<Category> result = (ArrayList<Category>)session.getAttribute("categories");
        Iterator<Category> iter;
        Category category;
        int i;
        if(result!=null){
            iter = result.iterator(); 
            i=0;
            while(iter.hasNext()){
                category = iter.next();
                
                
                
                if(i%3==0){                
                %>
                
                <script type="text/javascript">

                    $("div#categorypane").append("<br><br><br><br><br><br><br><br><br><br><br><br>");
    
                </script>
                <%
                              
                }
                %>
                <a onmouseover="javascript:categorylistover(<%=category.getCategoryID()%>)" onmouseout="javascript:categorylistout(<%=category.getCategoryID()%>)" href="categorymovies.jsp?name=<%=category.getCategoryName()%>" >    
                <div class="categories" id="list<%=category.getCategoryID()%>"style=" background-color: transparent;">
                
                <%
                try{
                if(category.getCategoryPic().isEmpty()==false){
                %>
                <img alt="<%=category.getCategoryName()%>" src="images/category/<%=category.getCategoryPic()%>" style="width:250px;height:140px;"/>;                
                <%
                }
                }catch(Exception ex){
                %>
                <img alt="noimage" src="images/category/categorynopic.png" style="width:250px;height:140px;"/>
                <%
                }
                %>
                <div id="categoryname<%=category.getCategoryName()%>" style="text-align: center; padding-top: 10px;">
                    <font color="white"><%=category.getCategoryName()%></font>
                </div>
                <%

                %>
                
                
                </div>
                </a>
                
                <%
                i++;
            }
        }
        
        %>          
    
    
    
    
    
</div>


